﻿@{
    Ajax.Dna().Widget()
         .UserPreferences(@<text>
    <div>
        @Html.Global("RES_URL")</div>
    <div style="margin-top: 5px;">
        <table>
            <tr>
                <td>
                    @(Ajax.Dna().TextBox(item.GenerateFieldID("Url"))
          .Value(item.UserPreferences["Url"] != null ? item.GetString("Url") : "http://")
                .GetHtml()
            )
                </td>
                <td>
                    @Ajax.Dna().Button(item.GenerateFieldID("btnBrowseIcon")).LocText("RES_BROWSE").Click("$dna.fileDlg(\"" + Url.Action("Dialog", "WebFiles", new { Area = "", website = WebSiteContext.Current.Web.Name }) + "\",$(\"#" + item.GenerateFieldID("Url") + "\"));").ImageIcons(Url.Content("~/content/images/icon_folder_open_16.gif")).GetHtml()
                </td>
            </tr>
        </table>
    </div>
    <div>@Html.Global("RES_WIDTH")</div>
    <div>@Ajax.Dna().TextBox(item.GenerateFieldID("Width")).NumericOnly().Value(item.GetInt("Width")).GetHtml()</div>
    <div>@Html.Global("RES_HEIGHT")</div>
    <div>@Ajax.Dna().TextBox(item.GenerateFieldID("Height")).NumericOnly().Value(item.GetInt("Height")).GetHtml()</div>
    </text>)
        .Content(@<text>
    @if (!string.IsNullOrEmpty(item.GetString("Url")))
    {
        @Video.Silverlight(Url.Content(item.GetString("Url")), item.GetInt("Width").ToString(), item.GetInt("Height").ToString());
    }
    </text>)
        .Render();
}
